home *** CD-ROM | disk | FTP | other *** search
- global gCDvolume, gCPU, gBreedDatabase, gBreedDatabaseCount, gGalleryDatabase, gGalleryDatabaseCount, gpGalleryIndex, gpGalleryBigSprite, gpGalleryBigLabelSprite, gpGalleryLabelZoneSprite, gpGalleryBigCastnum, gpGallerySmallCastnum, gpGalleryTextCastnum, gpGalleryBigTextCastnum, gpGalleryBigIsLoaded, gpGallerySlideshowIsRunning, gpGalleryPath, gpGalleryBreedPath, gpGalleryMarker
-
- on initGallery
- set gpGalleryBigSprite to 46
- set gpGalleryLabelZoneSprite to 47
- set gpGalleryBigLabelSprite to 48
- set gpGalleryBigCastnum to the number of cast "GalleryHolder.big"
- set gpGallerySmallCastnum to the number of cast "GalleryHolder.sml"
- set gpGalleryTextCastnum to the number of cast "GalleryText.sml"
- set gpGalleryBigTextCastnum to the number of cast "GalleryText.big"
- set gpGalleryBigIsLoaded to 0
- set gpGallerySlideshowIsRunning to 0
- if gCPU = #mac then
- set gpGalleryPath to gCDvolume & ":data:fun:gallery:"
- set gpGalleryBreedPath to gCDvolume & ":data:breeds:"
- else
- set gpGalleryPath to gCDvolume & "\data\fun\gallery\"
- set gpGalleryBreedPath to gCDvolume & "\data\breeds\"
- end if
- set gpGalleryMarker to "gallery"
- set gpGalleryIndex to 1
- installGallerySmallPhoto(gpGalleryIndex)
- end
-
- on enterGallery
- showAllSprites()
- hideSprite(gpGalleryBigSprite)
- hideSprite(gpGalleryBigLabelSprite)
- hideSprite(gpGalleryLabelZoneSprite)
- setFunMarker(getGalleryMarker())
- setHelpContext("fun")
- end
-
- on exitGallery
- showAllSprites()
- end
-
- on getGalleryMarker
- return gpGalleryMarker
- end
-
- on handleGalleryClickonBIG
- if gpGallerySlideshowIsRunning = 1 then
- stopGallerySlideshow()
- else
- hideGalleryBig()
- end if
- end
-
- on showGalleryBig
- closeSelectionMIAW()
- if gpGalleryBigIsLoaded = 0 then
- set gpGalleryBigIsLoaded to 1
- installGalleryBigPhoto(gpGalleryIndex)
- end if
- showSprite(gpGalleryBigSprite)
- showSprite(gpGalleryBigLabelSprite)
- showSprite(gpGalleryLabelZoneSprite)
- end
-
- on hideGalleryBig
- hideSprite(gpGalleryBigSprite)
- hideSprite(gpGalleryBigLabelSprite)
- hideSprite(gpGalleryLabelZoneSprite)
- pointerCursor()
- end
-
- on startGallerySlideshow
- closeSelectionMIAW()
- disableRandomSounds()
- showGalleryBig()
- updateStage()
- movieCursor()
- set the timeoutLength to 120
- set the timeoutScript to "rollSlideShow"
- set gpGallerySlideshowIsRunning to 1
- end
-
- on rollSlideShow
- if gpGalleryIndex >= gGalleryDatabaseCount then
- set gpGalleryIndex to 1
- else
- set gpGalleryIndex to gpGalleryIndex + 1
- end if
- waitCursor()
- installGalleryBigPhoto(gpGalleryIndex)
- updateStage()
- movieCursor()
- end
-
- on stopGallerySlideshow
- waitCursor()
- set gpGallerySlideshowIsRunning to 0
- installGallerySmallPhoto(gpGalleryIndex)
- set gpGalleryBigIsLoaded to 1
- hideGalleryBig()
- enableRandomSounds()
- pointerCursor()
- end
-
- on nextGallery
- if gpGalleryIndex >= gGalleryDatabaseCount then
- set gpGalleryIndex to 1
- else
- set gpGalleryIndex to gpGalleryIndex + 1
- end if
- installGallerySmallPhoto(gpGalleryIndex)
- end
-
- on prevGallery
- if gpGalleryIndex = 1 then
- set gpGalleryIndex to gGalleryDatabaseCount
- else
- set gpGalleryIndex to gpGalleryIndex - 1
- end if
- installGallerySmallPhoto(gpGalleryIndex)
- end
-
- on installGallerySmallPhoto theIndex
- set theRecord to getAt(gGalleryDatabase, theIndex)
- set theName to getAt(theRecord, 1)
- set theCode to getAt(theRecord, 2)
- set theGroup to getAt(theRecord, 3)
- set theDelim to getPathDelim()
- set gpGalleryBigIsLoaded to 0
- if theGroup = "gallery" then
- set theFile to gpGalleryPath & theCode & "3.pic"
- else
- set theFile to gpGalleryBreedPath & theGroup & theDelim & theCode & theDelim & theCode & "3.pic"
- end if
- relink(gpGallerySmallCastnum, theFile)
- set the text of cast gpGalleryTextCastnum to theName
- set gpGalleryIndex to theIndex
- end
-
- on installGalleryBigPhoto theIndex
- set theRecord to getAt(gGalleryDatabase, theIndex)
- set theName to getAt(theRecord, 1)
- set theCode to getAt(theRecord, 2)
- set theGroup to getAt(theRecord, 3)
- set theDelim to getPathDelim()
- if theGroup = "gallery" then
- set theFile to gpGalleryPath & theCode & "4.pic"
- else
- set theFile to gpGalleryBreedPath & theGroup & theDelim & theCode & theDelim & theCode & "4.pic"
- end if
- relink(gpGalleryBigCastnum, theFile)
- set the text of cast gpGalleryBigTextCastnum to theName
- end
-
- on handleGalleryPrint
- set theMsg to "Would you like to print the current photo?"
- set theAnswer to confirm(theMsg)
- if theAnswer = 0 then
- exit
- end if
- waitCursor()
- puppetSound("printing.aif")
- updateStage()
- installGalleryBigPhoto(gpGalleryIndex)
- printPICT(the picture of cast gpGalleryBigCastnum, the text of cast gpGalleryTextCastnum)
- pointerCursor()
- end
-
- on handleGallerySelectAPhoto
- set theString to EMPTY
- repeat with i = 1 to gGalleryDatabaseCount - 1
- set theString to theString & getAt(getAt(gGalleryDatabase, i), 1) & RETURN
- end repeat
- set theString to theString & getAt(getAt(gGalleryDatabase, gGalleryDatabaseCount), 1)
- set theCallback to "tell the stage to installGallerySmallPhoto(theIndex)"
- openSelectionMIAW(theString, "Select A Photo", theCallback)
- end
-